package action;

/**
 * ServiceCallListAction.java
 * Purpose: Allows the users to summarize service calls
 * 
 * @author Hans Brems
 * @version 1.0 31/05/2012
 */

import com.opensymphony.xwork2.ActionSupport;

import java.util.List;

import model.ServiceCall;
import persistency.ServiceCallRepository;

@SuppressWarnings("serial")
public class ServiceCallListAction extends ActionSupport {
	/* Holds all service calls */
	private List<ServiceCall> serviceCalls;
	
	/** Executes an incoming request */
	public String execute() throws Exception {
		ServiceCallRepository repository;
		
		// Get service calls
		repository = new ServiceCallRepository();
		this.serviceCalls = repository.getAll();
		return SUCCESS;
	}

	/** Returns the list of service calls */
	public List<ServiceCall> getServiceCalls() {
		return this.serviceCalls;
	}

	/** Sets the list of service calls */
	public void setServiceCalls(List<ServiceCall> serviceCalls) {
		this.serviceCalls = serviceCalls;
	}
}